<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>债转详情</title>
    <link rel="stylesheet" href="/css/reset.css">
    <link rel="stylesheet" href="/css/common.css">
    <link rel="stylesheet" href="/css/details.css">
    <link rel="stylesheet" href="/css/page.css">
    <link rel="stylesheet" href="/css/Pay_the_password.css">
    <script type="text/javascript" src="/js/assets/config.js"></script>
    <script type="text/javascript" src="/js/assets/require.js" data-main="/js/investment/debtDtails"></script>
    <style>
        .forgetJiaoyiPassword{
            color:#ff4545;
            margin-top:12px;
            margin-left: 140px;
            display: inline-block;
        }
    </style>
</head>
<body>
<#include "/include/header.ftl">
<div class="invest_container">
    <div class="invest_item">
        <h2 class="item_name">${debt.name}
        <#if item.itemIsnew == 1>
            <span class="hot" new>NEW</span>
        <#elseif item.itemIsnew == 0 && item.moveVip==1>
            <span class="hot" app>APP</span>
        <#elseif item.itemIsnew == 0 && item.moveVip==0 && item.itemIsrecommend==1>
            <span class="hot" hot>HOT</span>
        <#elseif item.itemIsnew == 0 && item.moveVip==0 && item.itemIsrecommend==0 && item.password?? && item.password!=''>
            <span class="hot" psw>LOCK</span>
        <#else>
            <span></span>
        </#if>
        </h2>
        <div class="invest_detail">
            <div>
                <p class="rate"><strong class="rate_int">${item.itemRate}</strong>
                	<span class="percent">%
                    <#if item.itemAddRate != 0>
                        +${item.itemAddRate}%
                    </#if>
                	</span></p>
                <p class="details_text">预期年化收益率</p>
            </div>
            <div class="circle">
                <p class="cash_num"><span id="itemCycleForCoupon">${debt.restPeriods!''}</span>天</p>
                <p class="details_text">剩余天数</p>
            </div>
            <div class="total_money">
                <p class="cash_num">${debt.amount!''}元</p>
                <p class="details_text">转让金额</p>
            </div>



            <div class="total_money"><#--这个地方是需要做判断去显示他的预期金额的-->
                <p class="cash_num">${debt.repayIncome}元</p>
                <p class="details_text">预期收益</p>
            </div>
            <div class="radialIndicator" id='rate' hidden data-value="${item.itemScale}" >
            </div>
        </div>
        <div class="invest_table" >
            <table>
                <tr>
                    <td width="76">还款方式</td>
                    <td width="120"><#if item.itemRepayMethod == 1>一次性还款<#elseif item.itemRepayMethod == 2>等额本息<#elseif item.itemRepayMethod == 3>先息后本<#elseif item.itemRepayMethod == 4>每日付息</#if></td>
                    <td width="76">债转价值</td>
                    <td width="154"><em id="minInvestMoney">${debt.amount!''}</em>元</td>
                    <#if debt.status==0>
                        <td width="76">剩余时间</td>
                        <td width="120">${strTime!''}</td>
                    <#else>
                        <td width="76"></td>
                    </#if>
                </tr>
                <tr>
                    <td>发布时间</td>
                    <td>
                    <#if item.releaseTime??>
                    ${item.releaseTime?string("yyyy-MM-dd")}</#if>
                    </td>
                </tr>
            </table>
        </div>
        <div class="invest_panel">
        <#if user??>
            <#if item.password?? && item.password!=''>
                <p class="text">剩余金额：<span id="itemAccountLeft">${(debt.amount-debt.ongoingAmount)?c}</span>元</p>
                <p class="text left_account">账户余额：<span  id="accountMoney">${user.usable}</span>元<a class='charge' href="/account/recharge/recharge?-1?3?0">充值</a></p>
                <p class="input_wrap left_account" style="padding:10px 0;"><input id='lockPsw' type="password"  placeholder="请输入定向密码"></p>
                <p class="input_wrap left_account" style="padding:10px 0;"><input data-value="isLock" type="number" id='usableMoney' placeholder="请输入投资金额"><span class='charge auto' id="autoValue" style="top:10px;">自动填入</span></p>

                <p class="input_wrap clear" style="padding:10px 0;">
                    <#if debt.status==0>
                        <input class='invest_button fl' type="button" value="立即投资" >
                    <#elseif debt.status==1>
                        <input class='invest_button fl' type="button" style="background: #c9c9c9;cursor: default"  value="已债转" >
                    <#else>
                        <input class='invest_button fl' type="button" style="background: #c9c9c9;cursor: default"  value="已过期" >
                    </#if>
                    <span class="caculator fl"></span>
                </p>
            <#else>
                <div class="get-money" >
                    <p class="text">剩余金额：<span id="itemAccountLeft">${(debt.amount-debt.ongoingAmount)?c}</span>元</p>
                    <p class="text left_account">账户余额：<span  id="accountMoney">${user.usable}</span>元<a class='charge' href="/account/recharge/recharge?-1?3?0">充值</a></p>
                    <p class="input_wrap left_account"><input data-value="noLock" type="number" id='usableMoney' placeholder="请输入投资金额"><span class='charge auto' id="autoValue">自动填入</span></p>
                    <p class="input_wrap clear" >
                </div>
                <div class="buy-money" hidden>  <#--这个是立即购买的div-->
                    <p class="text">剩余金额：<span id="itemAccountLeft">${(debt.amount-debt.ongoingAmount)?c}</span>元</p>
                    <p class="text left_account">账户余额：<span  id="accountMoney">${user.usable}</span>元<a class='charge' href="/account/recharge/recharge?-1?3?0">充值</a></p>
                    <p class="input_wrap left_account"><input data-value="noLock" type="number" id='usableMoney'
                                                              placeholder="请输入投资金额"></p>
                    <p class="input_wrap clear" >
                </div>
                <#if debt.status==0>
                    <input class='invest_button fl' type="button" value="立即投资" id="investNormal" >
                <#elseif debt.status==1>
                    <input class='invest_button fl' type="button" style="background: #c9c9c9;cursor: default"  value="已债转" >
                <#else>
                    <input class='invest_button fl' type="button" style="background: #c9c9c9;cursor: default"  value="已过期" >
                </#if>
                <span class="caculator fl"></span>
                </p>
            </#if>
        <#else>
            <p class="text">剩余金额：${item.itemAccount - item.itemOngoingAccount}元</p>
            <p class="input_wrap left_account"><input type="number" id='usableMoney' placeholder="请输入投资金额"></p>
            <p class="input_wrap clear" style="margin-top:-12px;">
                <a href="/login"><input class='invest_button fl' type="button" value="请登录"></a>
                <span class="caculator fl"></span>
            </p>
            <p class="no_account">没有账号？<a href="/register">立即注册</a></p>
        </#if>

        </div>
    </div>
    <div class="item_introduce">
        <div class="tab" id="tabs">
            <div class="tab_active">产品详情</div>
            <div>还款计划</div>
            <div>转让记录</div>
        </div>
        <div id="contents">
            <div class="tab_content" >
                <h3 class="title">转让说明</h3>
                <div class="type_box">
                    <p class="type_boxInfo">债权转让，是指投资人因个人原因急需资金，在初融共盈投资的借款项目转让给其他用户。债权转让能提高投资者资金的流动性，当你需要流动
                        资金时，可以通过出售你名下拥有的。符合相应条件的债权给其他投资人，从而完成债权转让，获得流动资金。</p>
                </div>
                <div class="img"></div>
                <h3 class="title">债权转让规则</h3>
                <div class="type_box">
                    <p class="type_boxInfo">1、债权转让的条件及注意事项</p>
                    <p class="type_boxInfo1">&nbsp;&nbsp;1）逾期债权均不得转让。</p>
                    <p class="type_boxInfo1">&nbsp;&nbsp;2）持有债权天数必须大于30天（含30天）方可转让。</p>
                    <p class="type_boxInfo1">&nbsp;&nbsp;3）距离当期还款日3日内（含3日），不能发起债权转让申请。</p>
                    <p class="type_boxInfo1">&nbsp;&nbsp;4）债权转让本金必须≥100元。</p>
                    <p class="type_boxInfo1">&nbsp;&nbsp;5）债权转让的时效为48小时，时段转让未成交则自动失效，转让期间投资收益归转让人所有，转让失败不扣除手续费。</p>
                    <p class="type_boxInfo1">&nbsp;&nbsp;6）转让一旦发起，则不可手动撤销。</p>
                    <p class="type_boxInfo1">&nbsp;&nbsp;7）债权转让和承接为按日计息的计算方式。</p>
                    <p class="type_boxInfo1">&nbsp;&nbsp;8）出借人发起债权转让可原价转让/打折转让，不可溢价转让。</p>
                    <p class="type_boxInfo1">&nbsp;&nbsp;9）客户发起债权转让后平台会在24小时内审核，审核通过后该标即进入转让专区。</p>
                    <p class="type_boxInfo1">10）转让期间，如原债权有还款，则系统自动撤销转让。</p>
                    <p class="type_boxInfo"> 2、债权转让收费吗</p>
                    <p class="type_boxInfo1"> 债权转让收费标准：按照转让金额，收取0.5%的手续费，最低1元/笔。费用由转让人支付。</p>
                    <p class="type_boxInfo">  3、承接人承接债权会产生费用吗？</p>
                    <p class="type_boxInfo1">  承接人承接标的不会产生任何费用。</p>
                    <p class="type_boxInfo">   4、如何操作债权转让？</p>
                    <p class="type_boxInfo1"> 登录初融共盈，点击【进入我的账户】-左边下拉菜单中【转让记录】，点击【债权转让】，在可转让项目中选择要转让的标的。</p>

                </div>
                <a href="/item/details/${item.id?c}?${item.id?c}"><div class="oldItem">查看原标信息</div></a>
                <input id="itemId" value="${item.id?c}" type="hidden"/>
            </div>
            <div class="tab_content" style="display: none">
                <table class="record">
                    <thead>
                    <tr><th>剩余期数</th><th>还款金额(元)</th><th>本金(元)</th><th>利息(元)</th><th>还款日期</th>
                        <#--<th>还款状态</th>-->
                    </tr>
                    </thead>
                    <tbody id="debtList">
                    </tbody>
                    <script id="debtListFunc" type="text/x-handlebars-template">
                        {{#each this}}
                        <tr>
                            <td>{{collectCurrentPeriod}}</td>
                            <td>{{collectAmount}}</td>
                            <td>{{collectPrincipal}}</td>
                            <td>{{collectInterest}}</td>
                            <td>{{collectTime}}</td>
                            <#--<td>未还</td>-->
                        </tr>
                        {{/each}}
                    </script>
                </table>
                <div class="pages">
                    <nav>
                        <ul id="debtpages" style="margin:84px auto">

                        </ul>
                    </nav>
                </div>
            </div>
            <div class="tab_content" style="display: none">
                <table class="record">
                    <thead>
                    <tr><th width="350">投资用户</th><th>投资金额（元）</th><th width="350">投资时间</th></tr>
                    </thead>
                    <tbody id="recordList">
                    </tbody>
                    <script id="recordListTemp" type="text/x-handlebars-template">
                        {{#each this}}
                        <tr><td>{{mobile}}&nbsp;&nbsp;
                            <img src="{{investType}}" alt="">
                        </td><td>{{investDealAmount}}</td><td>{{addtime}}</td></tr>
                        {{/each}}
                    </script>
                </table>
                <div class="pages">
                    <nav>
                        <ul id="pages" style="margin:84px auto">

                        </ul>
                    </nav>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="footer" style="margin-top: 100px">
<#include "/include/footer.ftl">
</div>
<#--立即投资,无需充值-->
<div class="bg_panel" style="display: none" id="couponPanel">
    <div class="panel">
        <div class="close"></div>
        <div class="total" style="margin-bottom:20px;"><span class="fl" id="">投资总额&nbsp;&nbsp;<em id="investAccountTotal"></em><em id="couponAmount" style="color:#ff5757"></em></span><span class="fr">
            预期收益&nbsp;&nbsp;<em id="itemIncome"></em>
            <em style="color:#ff5757" id="couponIncome"></em>
        </span></div>
        <div class="alieditContainer" id="payPassword_container">
            请输入交易密码：
            <input minlength="6" maxlength="6" tabindex="1" id="payPassword_rsainput" name="payPassword_rsainput" class="ui-input i-text" oncontextmenu="return false" onpaste="return false" oncopy="return false" oncut="return false" autocomplete="off" value="" type="password">
            <div class="sixDigitPassword" tabindex="0" style="margin-top: 30px">
                <i><b></b></i>
                <i><b></b></i>
                <i><b></b></i>
                <i><b></b></i>
                <i><b></b></i>
                <i><b></b></i>
                <span class="guangbiao" style="left:0px;"></span>
            </div>
        </div>

        <div class="agreement"><label for=""><input checked type="checkbox" id="agreement">&nbsp;&nbsp;我同意<a style="color: #5F5F5F !important;" href="/html/investxy.html" target="_blank">《投资协议》</a></label><a class="forgetJiaoyiPassword" href="/user/security">忘记交易密码？</a></div>
        <div class="invest"><input type="button" value="立即投资" id="investFinal"></div>
    </div>
</div>
<#--立即投资,需充值-->
<div class="bg_panel" style="display: none" id="needRecharge">
    <div class="panel">
        <div class="close"></div>
        <div class="tips">当前账户余额不足，是否前去<strong>充值</strong>？</div>
        <div class="confirm" >
            <input  style='cursor: pointer;' id="rechargeCancle"  class='no' type="button" value="取消">
            <a href="/account/recharge/recharge?-1?3?0"><input id='doRecharge' class='yes' type="button" value="确定"></a>
        </div>
    </div>
</div>
<#--收益计算器-->
<div class="bg_panel" style="display: none" id="cacuPanel">
    <div class="panel panel-max">
        <div class="close" id="cacuClose"></div>
        <div class="padding-box clear">
            <div class="data fl">
                <div class="title">收益计算器</div>
                <table>
                    <tr><td>投资期限：</td><td><span id="investCycle">${item.itemCycle}</span><#if item.itemCycleUnit == 1>天<#elseif item.itemCycleUnit == 2>月<#elseif item.itemCycleUnit == 3>季<#elseif item.itemCycleUnit == 4>年</#if></td></tr>
                    <tr><td>年化利率：</td><td id="investRate">${item.itemRate+item.itemAddRate}%</td></tr>
                    <tr><td>还款方式：</td><td id="repayMethod"><#if item.itemRepayMethod == 1>一次性还款<#elseif item.itemRepayMethod == 2>等额本息<#elseif item.itemRepayMethod == 3>先息后本<#elseif item.itemRepayMethod == 4>每日付息</#if></td></tr>
                    <tr><td>投资金额：</td><td  class="input_text"><input id='investMoneyCalcu' type="number" data-value="${item.itemAccount - item.itemOngoingAccount}"></td></tr>
                </table>
                <div class="cacu_button">
                    <input id='cacu' class='cacu' type="button" value="计算">
                    <input id='reset' class='reset' type="button" value="重置">
                </div>
            </div>
            <div class="result fl">
                <div class="title">计算结果</div>
            <#if item.itemRepayMethod == 1>
                <table>   <#--一次性还款-->
                    <tr><td>当期利息：</td><td><strong id="everyIntrerst_2"></strong>元</td></tr>
                    <tr><td>本息合计：</td><td><strong id="total_2"></strong>元</td></tr>
                </table>
            <#elseif item.itemRepayMethod == 3>
                <table>     <#--先息后本-->
                    <tr><td>每期利息：</td><td><strong id="intrerst_1"></strong>元</td></tr>
                    <tr><td>本息合计：</td><td><strong id="total_1"></strong>元</td></tr>
                </table>
            <#else>
                <table>
                    <tr><td>利息收入：</td><td><strong id="intrerst_3"></strong>元</td></tr>
                    <tr><td>本息合计：</td><td><strong id="total_3"></strong>元</td></tr>
                </table>
            </#if>
                <div class="text">
                    注：30天为1期，计算结果仅作参
                    考，最终以实际收益为准
                </div>
            </div>
        </div>
    </div>
</div>
<#include "/include/smalldetails.ftl">
</body>
</html>
